<?php $auth=0; ?>
<?php include 'lib/includes.php'; ?>
<?php 
if(isset($_POST['username'])&& isset($_POST['password']))
{
	$username=$db->quote($_POST['username']);
	$password=sha1($_POST['password']);
	$select=$db->query("select * from vendeur where vendeurMail=$username and vendeurMp='$password'");
	if($select->rowCount() > 0)
	{
		$_SESSION['auth']=$select->fetch();
		//setFlash('connecté');
		header('Location:'.WEBROOT.'company.php');
		die();
	}
}
include 'partials/header.php'; 
?>
<form class="form-horizontal" action="#" method="post">
  <div class="form-group">
    <label for="username" class="col-sm-5 control-label">nom d'utilisateur</label>
    <div class="col-sm-3">
     <?php 
	 echo input('username');
	 ?>
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-5 control-label">mot de passe </label>
    <div class="col-sm-3">
     <input type="password" class="form-control" id="password" name="password">
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-5 col-sm-10">
      <button type="submit" class="btn btn-default">Se connecter </button>
    </div>
  </div>
</form>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br>
<?php include 'partials/footer.php'; ?>
